<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function jsq(op){
var a=parseFloat(document.getElementById("num1").value);
var b=parseFloat(document.getElementById("num2").value);

switch (op){
	case "+":
	document.getElementById("result").value=a+b;
	break;
	case "-":
	document.getElementById("result").value=a-b;
	break;
	case "*":
	document.getElementById("result").value=a*b;
	break;
	case "/":
	document.getElementById("result").value=a/b;
	break;
}
}
</script>


<body>
num1:
<input type="text" id="num1">
<br>num2:
<input type="text" id="num2">
<br>op:
<input type="button" value="+" onClick="jsq('+')">
<input type="button" value="-" onClick="jsq('-')">
<input type="button" value="*" onClick="jsq('*')">
<input type="button" value="/" onClick="jsq('/')">
<br>result:
<input type="text" id="result">
</body>
</head>
</html>
